import { backstageUrl, baseUrl } from "./config.js";
import Axios from "axios";


export let getPatrolNumRankApi = (schoolId, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "dailystatistics/getPatrolNumRank", {
            schoolId: schoolId,
            startTime: startTime,
            endTime: endTime
        })
    );
};

export let getBranchCompusApi = (schoolId) => {
    return (
        Axios.post(backstageUrl + "dailystatistics/getBranchCompus", {
            schoolId: schoolId,
        })
    );
};

export let getPatrolRatesRankApi = (schoolId, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "dailystatistics/getPatrolRatesRank", {
            schoolId: schoolId,
            startTime: startTime,
            endTime: endTime 
        })
    );
};

export let getPatrolPointsRankApi = (schoolId, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "dailystatistics/getPatrolPointsRank", {
            schoolId: schoolId,
            startTime: startTime,
            endTime: endTime 
        })
    );
};

export let getDangerNumRankApi = (schoolId, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "dailystatistics/getDangerNumRank", {
            schoolId: schoolId,
            startTime: startTime,
            endTime: endTime 
        })
    );
};

export let getDangerCategoryApi = (schoolId, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "dailystatistics/getDangerCategory", {
            schoolId: schoolId,
            startTime: startTime,
            endTime: endTime 
        })
    );
};

export let getDangerDealRateApi = (schoolId, startTime, endTime) => {
    return (
        Axios.post(backstageUrl + "dailystatistics/getDangerDealRate", {
            schoolId: schoolId,
            startTime: startTime,
            endTime: endTime 
        })
    );
};

//个人巡检次数排名
export let getIndividualInspectNumRankApi = (schoolId, startTime, endTime) => {
    return (
        Axios.get(backstageUrl + "dailystatistics/getIndividualInspectNumRank", {
            params: {
                schoolId: schoolId,
                startTime: startTime,
                endTime: endTime
            }
        })
    );
}

//巡检班组完成率排名
export let getInspectClassRatesApi = (schoolId, startTime, endTime) => {
    return (
        Axios.get(backstageUrl + "dailystatistics/getInspectClassRates", {
            params: {
                schoolId: schoolId,
                startTime: startTime,
                endTime: endTime
            }
        })
    );
}


//巡检个人积分排名
export let getIndividualInspectPointsRankApi = (schoolId, startTime, endTime) => {
    return (
        Axios.get(backstageUrl + "dailystatistics/getIndividualInspectPointsRank", {
            params: {
                schoolId: schoolId,
                startTime: startTime,
                endTime: endTime
            }
        })
    );
}

//巡检班组积分排名
export let getInspectClassPointsRankApi = (schoolId, startTime, endTime) => {
    return (
        Axios.get(backstageUrl + "dailystatistics/getInspectClassPointsRank", {
            params: {
                schoolId: schoolId,
                startTime: startTime,
                endTime: endTime
            }
        })
    );
}




